package com.dj.controller;

import com.dj.common.Result;
import com.dj.common.entity.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.ArrayList;
import java.util.List;

@RestController
public class DeptController {
    @Autowired
    private RestTemplate restTemplate;
    private static final String REST_URL_PREFIX = "http://localhost:8001";

    @RequestMapping("/consumer/dept/getAll")
    public Result getAll(){
        return (Result) restTemplate.getForObject(REST_URL_PREFIX+"/providerdept8001/dept/getAll", Result.class);
    }
}
